import Vue from "vue";
import App from "./App.vue";
import ElementUI from "element-ui";
import router from "@/router";
// import 'element-ui/lib/theme-chalk/index.css'
import "@/styles/index.css"; // 引入初始化css
import "@/styles/element-#C20C0C/index.css"; // 引入自定义elementUI主题
import store from "@/store";
import loadingImg from '@/assets/lazy.png'
import VueLazyload from 'vue-lazyload'


Vue.use(VueLazyload, {
  loading: loadingImg,
})
Vue.use(ElementUI);

// 注册全局组件
import Comment from "@/components/Comment/Comment";
import Record from "@/components/Record/Record";
import Login from "@/components/Login/Login";
import SongList from "@/components/SongList/SongList";
import APlayer from "@moefe/vue-aplayer";
import pic from "@/assets/lazy.png";
Vue.use(APlayer, {
  defaultCover: pic,
  productionTip: true,
});
Vue.component(SongList.name, SongList);
Vue.component(Login.name, Login);
Vue.component(Comment.name, Comment);
Vue.component(Record.name, Record);
// 引入相关API请求接口
import API from "@/api";


Vue.config.productionTip = false;
new Vue({
  render: (h) => h(App),
  router,
  store,
  beforeCreate() {
    Vue.prototype.$bus = this; // 注册全局事件总线
    Vue.prototype.$API = API;
  },
}).$mount("#app");
